<template>

  <!-- 完全变为了视图组件 -->
  <section class="work-sit-info">
    <h4>{{title}}:</h4>

    <!--    <el-form :inline="true" label-width="150px" style="width: 938px">-->
    <!--      <el-form-item label="工位名称：">-->
    <!--        <span>{{workStationData.Name}}</span>-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="工位线体：">-->
    <!--        <span>{{workStationData.LineName}}</span>-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="所属车间：">-->
    <!--        <span>{{workStationData.WorkShopName}}</span>-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="操作人员：">-->
    <!--        <span>{{workStationData.LastModifyBy}}</span>-->
    <!--      </el-form-item>-->
    <!--    </el-form>-->

    <el-row style="padding-top: 20px">
      <el-col :span="6">
        <span>工位名称：</span>
        <span>{{workStationData.Name}}</span>
      </el-col>
      <el-col :span="6">
        <span>工位线体：</span>
        <span>{{workStationData.LineName}}</span>
      </el-col>
      <el-col :span="6">
        <span>所属车间：</span>
        <span>{{workStationData.WorkShopName}}</span>
      </el-col>
      <el-col :span="6">
        <span>操作员：</span>
        <span>{{workStationData.LastModifyBy}}</span>
      </el-col>
    </el-row>

    <slot name="more"/>
  </section>
</template>

<script>
  import { getYourIP } from '@/utils/getIp'
  import { getWorkStationInfo } from '@/api/scan'

  export default {
    name: 'WorkSitInfo',
    props: {
      workStationData: {
        type: Object,
        require: true
      },
      title: {
        type: String,
        default: '工位信息展示'
      }

      // techType	是	int	工序类型 0.普通工序 6.输出分拣 9.包装工序 10.成品分拣 15.质检工序 16.维修处理
      // techType: {
      //   type: Number,
      //   require: true
      // },
      // ipAddress: {
      //   type: [Number, String],
      //   default: getYourIP() //  	当前登录电脑IP地址
      // },
      // lineId: { //  用户通过select框选中的线体ID
      //   type: Number,
      //   require: true
      // }
    },
    data() {
      return {
        // workStationData: {}

      }
    },
    computed: {
      // compose() {
      //   const { lineId, techType, ipAddress } = this
      //   return { lineId, techType, ipAddress }
      // }
    },
    created() {

    },
    watch: {
      // async compose({ lineId, techType, ipAddress }) {
      //通过电脑IP地址 和 工作顺序 获取当前工位信息
      // const { Code, Result } =
      //   await getWorkStationInfo({ ipAddress, techType, lineId: +lineId })
      // if ((+Code) === 1) {
      //   this.workStationData = res.Result
      // }

      // await getTechByTechId({techId:parseInt(this.workStationData.TechId)})
      // .then(res => {
      // if(parseInt(res.Code) === 1){
      //   this.workStationData = res.Result
      //   getTechByTechId({techId:parseInt(this.workStationData.TechId)}).then(res => {
      //     if(parseInt(res.Code) === 1){
      //       this.photoData = res.Result.TechGuides
      //     }

      // }
    }
  }
</script>

<style lang="scss" scoped>
  @import "~@/styles/index.scss";

  .work-sit-info {
    border: 1px solid $borderColor;
    border-radius: 3px;
    padding: 30px;

    .ul-list {
      display: flex;

      justify-content: space-around;
      padding-top: 20px;
      font-weight: normal;
    }
  }
</style>
